<?php

class sinaController extends base
{

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 保存微博用户
     */
    public function dosaveSinaUser()
    {
        $sina_id = common::request('sina_id', 'P');
        $sina_token = common::request('sina_token', 'P');
        $expire = common::request('expire', 'P');

        if ($sina_id && $sina_token && $expire)
        {
            $data = $this->load('sina')->saveUser($sina_id, $sina_token);

            $this->result['result'] = array_merge($this->userInfo, $data);
        }
        else
        {
            $_ENV['error']->getErrors(101);
        }
    }
    
    /**
     * 
     */
    public function doshare()
    {
        $this->result['result'] = '<h1>分享成功</h1>';
    }

}
